package m.jclecai.com.adapter;

import android.content.Context;
import android.view.ViewGroup;

import m.jclecai.com.R;

import java.util.List;

import m.jclecai.com.adapter.base.ViewHolerAdapter;
import m.jclecai.com.adapter.holder.GroupBuyHolder;
import m.jclecai.com.bean.GroupBuyBean;

/**
 * Created by ZD on 2017/5/15.
 */

public class GroupBuyAdapter extends ViewHolerAdapter<GroupBuyHolder> {

    private List<GroupBuyBean> lists;
    private Context mContext;

    public GroupBuyAdapter(Context context, List<GroupBuyBean> lists) {
        this.mContext = context;
        this.lists = lists;
    }

    @Override
    public GroupBuyHolder onCreateViewHolder(int position, ViewGroup parent) {
        return new GroupBuyHolder(mContext, R.layout.item_group_buy);
    }

    @Override
    public void onBindViewHolder(int position, GroupBuyHolder groupBuyHolder) {
        GroupBuyBean bean = lists.get(position);
        groupBuyHolder.init(bean);
    }

    @Override
    public int getCount() {
        return this.lists.size();
    }
}
